#!/usr/bin/env python
PACKAGE = "esvo_core"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# for EventMatcher
gen.add("EM_TIME_THRESHOLD", double_t, 0, "EM_TIME_THRESHOLD", 0.0001, 0.000001, 0.001)
gen.add("EM_EPIPOLAR_THRESHOLD", double_t, 0, "EM_EPIPOLAR_THRESHOLD", 0.5, 0.1, 5)
gen.add("EM_TS_NCC_THRESHOLD", double_t, 0, "EM_TS_NCC_THRESHOLD", 0.1, 0.0, 1.0)
gen.add("EM_NUM_EVENT_MATCHING", int_t, 0, "EM_NUM_EVENT_MATCHING", 30000, 0, 100000)
gen.add("EM_PATCH_INTENSITY_THRESHOLD", int_t, 0, "EM_PATCH_INTENSITY_THRESHOLD", 125, 0, 255)
gen.add("EM_PATCH_VALID_RATIO", double_t, 0, "EM_PATCH_VALID_RATIO", 0.1, 0, 1.0)

# for Block Matcher
gen.add("BM_MAX_NUM_EVENTS_PER_MATCHING", int_t, 0, "BM_MAX_NUM_EVENTS_PER_MATCHING", 400, 1, 50000)
gen.add("BM_min_disparity", int_t, 0, "BM_min_disparity", 0, 0, 5)
gen.add("BM_max_disparity", int_t, 0, "BM_max_disparity", 40, 0, 150)
gen.add("BM_step", int_t, 0, "BM_step", 2, 1, 5)
gen.add("BM_ZNCC_Threshold", double_t, 0, "BM_ZNCC_Threshold", 0.1, 0, 1.0)

# for esvo_Mapping
gen.add("invDepth_min_range", double_t, 0, "InvDepth_MIN_RANGE", 0.16, 0.0, 10.0)
gen.add("invDepth_max_range", double_t, 0, "InvDepth_MAX_RANGE", 2.0, 0.0, 10.0)

gen.add("residual_vis_threshold", double_t, 0, "Residual_VIS_THRESHOLD", 12, 0.0, 1000000)
gen.add("stdVar_vis_threshold", double_t,   0, "StdVariance_VIS_THRESHOLD",  0.12, 0.0, 10000000)

gen.add("age_max_range", int_t,   0, "Age_MAX_RANGE",  5, 0, 10)
gen.add("age_vis_threshold", int_t,   0, "Age_VIS_RANGE",  1, 0, 10)

gen.add("fusion_radius", int_t, 0, "fusion radius", 0, 0, 5)
gen.add("maxNumFusionFrames", int_t, 0, "Max Fusion Times", 0, 0, 100)
gen.add("maxNumFusionPoints", int_t, 0, "Max Fusion Points",5000, 1000, 20000)
gen.add("PROCESS_EVENT_NUM", int_t, 0, "#processed event", 100, 0, 100000)
gen.add("TS_HISTORY_LENGTH", int_t, 0, "time_surface history length", 100, 0, 300)
gen.add("mapping_rate_hz", int_t, 0, "mapping rate", 20, 1, 30)

gen.add("Denoising", bool_t, 0, "denoising the events", False)
gen.add("Regularization", bool_t, 0, "perform regularization", False)

# for esvo_System
gen.add("ResetButton", bool_t, 0, "reset system (used as a button...)", False)
exit(gen.generate(PACKAGE, "esvo_core", "DVS_MappingStereo"))